#include "basicwidget.h"

BasicWidget::BasicWidget(QWidget *parent) : QMainWindow(parent)
{
    this->setGeometry(0,360,560,260);
    QFont Titlefont("Arial",16);
    for(int i=0;i<BASE_LabelNum;i++)
    {
        QLabel *label = new QLabel(this);
        BASE_labellist.append(label);
        BASE_labellist.at(i)->setFont(Titlefont);
    }
    //显示大标题
    BASE_labellist.at(0)->setGeometry(0,0,640,30);
    BASE_labellist.at(0)->setText("浓度");
    BASE_labellist.at(0)->setAlignment(Qt::AlignCenter);//字体居中显示
    BASE_labellist.at(0)->setFont(Titlefont);
    BASE_labellist.at(0)->setFrameStyle(17); //因为有黑边所以要设置frame
    //显示小标题
    BASE_labellist.at(1)->setGeometry(10,180,300,30);
    BASE_labellist.at(1)->setText("");
    BASE_labellist.at(1)->setFont(Titlefont);
    //显示数据名称
    BASE_labellist.at(2)->setGeometry(30,30,100,40);
    BASE_labellist.at(2)->setText("Flow");
    //显示数据
    BASE_labellist.at(3)->setGeometry(260,30,120,40);
    BASE_labellist.at(3)->setText("0.0");
    BASE_labellist.at(3)->setAlignment(Qt::AlignCenter);
    //显示单位
    BASE_labellist.at(4)->setGeometry(520,30,90,40);
    BASE_labellist.at(4)->setAlignment(Qt::AlignRight);
    BASE_labellist.at(4)->setText("l/min");
    //显示数据名称2
    BASE_labellist.at(10)->setGeometry(30,60,100,40);
    BASE_labellist.at(10)->setText("Flow");
    //显示数据2
    BASE_labellist.at(11)->setGeometry(260,60,120,40);
    BASE_labellist.at(11)->setText("0.0");
    BASE_labellist.at(11)->setAlignment(Qt::AlignCenter);
    //显示单位2
    BASE_labellist.at(12)->setGeometry(520,90,90,40);
    BASE_labellist.at(12)->setAlignment(Qt::AlignRight);
    BASE_labellist.at(12)->setText("l/min");
    //显示数据名称3
    BASE_labellist.at(13)->setGeometry(30,90,100,40);
    BASE_labellist.at(13)->setText("Flow");
    //显示数据3
    BASE_labellist.at(14)->setGeometry(260,90,120,40);
    BASE_labellist.at(14)->setText("0.0");
    BASE_labellist.at(14)->setAlignment(Qt::AlignCenter);
    //显示单位3
    BASE_labellist.at(15)->setGeometry(520,60,90,40);
    BASE_labellist.at(15)->setAlignment(Qt::AlignRight);
    BASE_labellist.at(15)->setText("l/min");
    //显示锁图标
    BASE_labellist.at(5)->setGeometry(520,130,38,37);
    BASE_labellist.at(5)->setStyleSheet("QLabel{image: url(:/jpg/lock.png);}");
    //显示维护图标
    BASE_labellist.at(6)->setGeometry(557,132,41,37);
    BASE_labellist.at(6)->setStyleSheet("QLabel{image: url(:/jpg/protect4-4.png);}");
    //显示警报图标
    BASE_labellist.at(7)->setGeometry(600,132,38,37);
    BASE_labellist.at(7)->setStyleSheet("QLabel{image: url(:/jpg/warn1.png);}");
    //显示时间图标
    BASE_labellist.at(8)->setGeometry(0,130,640,40);
    BASE_labellist.at(8)->setFrameStyle(17);
    BASE_labellist.at(8)->setAlignment(Qt::AlignCenter);//字体居中显示黑边所以要设置frame
    //显示其他信息
    BASE_labellist.at(9)->setGeometry(0,132,231,40);
    BASE_labellist.at(9)->setText("");
    BASE_labellist.at(9)->setFont(Titlefont);
}
